package com.qtu.order_service.controller;

import com.qtu.entity.BmInordergoodslist;
import com.qtu.order_service.entity.Details;
import com.qtu.order_service.service.BmInordergoodslistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("api/goods")
public class GoodslistController {

    @Autowired
    private BmInordergoodslistService bmInordergoodslistService;

    /**
     * 查询订单商品详情
     * @param orderId
     * @return
     */
    @ResponseBody
    @RequestMapping("getGoodsDetails")
    public List<Details> getGoodsDetails(String token,Integer orderId){
        return bmInordergoodslistService.getGoodsDetails(orderId);
    }

    /**
     * 查询店铺订单商品
     * @return
     */
    @RequestMapping("getGoods")
    @ResponseBody
    public List<BmInordergoodslist> getGoods(String token,Integer sellerId){
        return bmInordergoodslistService.getGoods(sellerId);
    }
}